import { request } from '@/util/api.js'
const actions = {
  async getSwiper({ commit }) {
    let res = await request('home/swiperdata');
    if(res.statusCode === 200){
		this.commit('GETSWIPER', res.data.message)
	}
  },
  async getCatitems({ commit }) {
    let res = await request('home/catitems');
	if(res.statusCode === 200){
		this.commit('GETCATITEMS', res.data.message)
	}
  },
  async getFloordata({ commit }) {
    let res = await request('home/floordata');
  	if(res.statusCode === 200){
		return res
  	}
  },
  async getCategories({ commit }) {
    let res = await request('categories');
  	if(res.statusCode === 200){
  		return res
  	}
  },
  async getGoodsList({ commit },params) {
    let res = await request('goods/search','get',params);
  	if(res.statusCode === 200){
  		return res
  	}
  },
  async getGoodDetail({ commit },params) {
    let res = await request('goods/detail','get',params);
  	if(res.statusCode === 200){
  		return res
  	}
  },
}

export default actions
